
#ifndef __CONFIG_H__
#define __CONFIG_H__

#define CONFIG_STRING	32

typedef struct config_odcontrol_t config_odcontrol_t;
struct config_odcontrol_t
{
	char board_name[CONFIG_STRING];
	char web_user[CONFIG_STRING];
	char web_pass[CONFIG_STRING];
	char version[CONFIG_STRING];
};

typedef struct config_analogic_t config_analogic_t;
struct config_analogic_t
{
	char port[CONFIG_STRING];
	char A_param[CONFIG_STRING];
	char B_param[CONFIG_STRING];
	int active;
	int visible;
	int tolerance;
};

typedef struct config_digital_t config_digital_t;
struct config_digital_t
{
	char port[CONFIG_STRING];
	int visible;
};

typedef struct config_virtual_t config_virtual_t;
struct config_virtual_t
{
	char port[CONFIG_STRING];
	int visible;
	char type[CONFIG_STRING];
	
	// value
	char ad[CONFIG_STRING];
	char value[CONFIG_STRING];
	
	// group
	char port1[CONFIG_STRING];
	char port2[CONFIG_STRING];
	char op[CONFIG_STRING];

	// trigger
	char cnd[CONFIG_STRING];
	char cndp[CONFIG_STRING];
	char outp[CONFIG_STRING];
	char outval[CONFIG_STRING];
};


typedef struct config_links_t config_links_t;
struct config_links_t
{
	char src[CONFIG_STRING];
	char dst[CONFIG_STRING];
	char type[CONFIG_STRING];
};


typedef struct config_network_t config_network_t;
struct config_network_t
{
	char ip[4][CONFIG_STRING];
	char mask[4][CONFIG_STRING];
	char gw[4][CONFIG_STRING];
	char mac[6][CONFIG_STRING];
};


typedef struct config_t config_t;
struct config_t
{
	config_odcontrol_t tab_odcontrol;
	config_analogic_t tab_analogic[8];
	config_digital_t tab_digital_i[8];
	config_digital_t tab_digital_o[8];
	config_virtual_t tab_virtual[16];
	config_links_t tab_links[16];
	config_network_t tab_network;
};



#endif








